/*
 * FunctionObjects.h
 *
 *  Created on: 2013-1-24
 *      Author: Administrator
 */

#ifndef FUNCTIONOBJECTS_H_
#define FUNCTIONOBJECTS_H_
#include <vector>

class CountNumberK
{
public:
	CountNumberK();
	~CountNumberK();
	int operator() (const std::vector<int>& array, int k);

private:
	int _findFirstK(const std::vector<int>& array, int k, int firstPos, int lastPos);
	int _findLastK(const std::vector<int>& array, int k, int firstPos, int lastPos);
};

#endif /* FUNCTIONOBJECTS_H_ */
